define(function() {
    var headerKeyFilter = angular.module('app.filter.headerKey', []);

    headerKeyFilter.filter('xHeaderKey', function() {
        return function(text) {
            if (text) {
                var headerKey = '',
                    nextUpperCase = true;
                for (var i = 0; i < text.length; i++) {
                    var char = text.charAt(i);
                    if (char == '-') {
                        nextUpperCase = true;
                    } else if (nextUpperCase) {
                        char = char.toUpperCase();
                        nextUpperCase = false;
                    }
                    headerKey += char;
                }
                return headerKey;
            }
            return text;
        }
    });

    return headerKeyFilter;
});